/**
 * @file MotorData.h
 * @author  
 * @brief 电机、风机数据类型
 * @version 1.0
 * @date 2020-07-23
 * 
 * @copyright Copyright (c) 2020
 * 
 */

#pragma once
#include <cstdint>
#include "lib/Time.h"

namespace behavior_controller
{
    class MotorData
    {
    public:
        MotorData(){};
        MotorData(double power_wheel_left, double power_wheel_right,
                  double power_fan_motor, double power_worm_motor, double fan_speed,
                  double brush_speed, uint8_t overcurrent)
            : power_wheel_left_(power_wheel_left),
              power_wheel_right_(power_wheel_right),
              power_fan_motor_(power_fan_motor),
              power_brush_motor_(power_worm_motor),
              fan_speed_(fan_speed),
              brush_speed_(brush_speed),
              overcurrent_(overcurrent){};
        /**
         * @brief 返回左轮功率
         * @return
         */
        double power_wheel_left() const { return power_wheel_left_; }
        /**
         * @brief 返回右轮功率
         * @return
         */
        double power_wheel_right() const { return power_wheel_right_; }
        /**
         * @brief 返回风机功率
         * @return
         */
        double power_fan_motor() const { return power_fan_motor_; }
        /**
         * @brief 返回蜗杆功率
         * @return
         */
        double power_brush_motor() const { return power_brush_motor_; }
        /**
         * @brief 返回风机转速
         * @return
         */
        double fan_speed() const { return fan_speed_; }
        /**
         * @brief 返回边刷转速
         * @return
         */
        double brush_speed() const { return brush_speed_; }
        /**
         * @brief 返回驱动轮过流信息，第一位为左轮过流标志位，第二位为右轮过流标志位
         * @return
         */
        uint8_t overcurrent_flag() const { return overcurrent_; }
        void  SetTime() {real_time= Time::Now();};
        void  SetTime(double _time) {real_time= _time;};
        double GetRealTime(){return real_time;};
        ~MotorData(){};

    private:
        double real_time=0;
        double power_wheel_left_;  //左轮功率
        double power_wheel_right_; //右轮功率
        double power_fan_motor_;   //风机功率
        double power_brush_motor_; //边刷电机功率
        double fan_speed_;         //风机速度
        double brush_speed_;       //边刷速度
        uint8_t overcurrent_;     //过流信号
    };                            // namespace behavior_controller
} // namespace behavior_controller